/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package carrito;

import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Stroke;
import java.awt.geom.Ellipse2D;
import java.awt.geom.Line2D;
import java.awt.geom.Rectangle2D;
import java.awt.geom.RoundRectangle2D;
import javax.swing.JFrame;

/**
 *
 * @author Monica
 */
public class Diagrama extends JFrame {

    public Diagrama() {
        this.setSize(500, 400);
    }

    @Override
    public void paint(Graphics g) {
        super.paint(g);
        Graphics2D g2 = (Graphics2D) g;
         
        //cabeza
        Rectangle2D r1 = new Rectangle2D.Float(200, 150, 65, 50);
        Stroke pincel
                = new BasicStroke(4.0f, BasicStroke.CAP_ROUND, BasicStroke.CAP_ROUND);
        g2.setStroke(pincel);
        g2.draw(r1);
        g2.setColor(Color.red);
        g2.fill(r1);
        
        //linea de enmedio
       Rectangle2D r2 = new Rectangle2D.Float(233, 150, 0, 50);
       g2.setColor(Color.BLACK);
       g2.setStroke(pincel);
       g2.draw(r2);
       g2.setColor(Color.MAGENTA);
       g2.fill(r2);
       
      
       
       //parte de abajo ventana
       Rectangle2D r3 = new Rectangle2D.Float(155, 200, 155, 50);
       g2.setColor(Color.BLACK);
       g2.setStroke(pincel);
       g2.draw(r3);
       g2.setColor(Color.MAGENTA);
       g2.fill(r3);
       
       //primera ventana
           Rectangle2D r4= new Rectangle2D.Float(205, 155, 20, 40);
       g2.setColor(Color.BLACK);
       g2.setStroke(pincel);
       g2.draw(r4);
       g2.setColor(Color.cyan);
       g2.fill(r4);
       
       //segunda ventana
        Rectangle2D r5= new Rectangle2D.Float(240, 155, 20, 40);
       g2.setColor(Color.BLACK);
       g2.setStroke(pincel);
       g2.draw(r5);
       g2.setColor(Color.cyan);
       g2.fill(r5);
       
       //lanta1
       Ellipse2D e5= new Ellipse2D.Float(165,240,30,30);
       g2.setColor(Color.blue);
       g2.setStroke(pincel);
       g2.draw(e5);
       g2.setColor(Color.YELLOW);
       g2.fill(e5);
       
             //llanta2
       Ellipse2D e2= new Ellipse2D.Float(260,240,30,30);
       g2.setColor(Color.blue);
       g2.setStroke(pincel);
       g2.draw(e2);
       g2.setColor(Color.YELLOW);
       g2.fill(e2);
       
       //lanta 1 aro
       Ellipse2D e6= new Ellipse2D.Float(173,247,15,15);
       g2.setColor(Color.BLACK);
       g2.setStroke(pincel);
       g2.draw(e6);
       g2.setColor(Color.BLUE);
       g2.fill(e6);
       
         //lanta 2 2aro
       Ellipse2D e7= new Ellipse2D.Float(267,247,15,15);
       g2.setColor(Color.BLACK);
       g2.setStroke(pincel);
       g2.draw(e7);
       g2.setColor(Color.BLUE);
       g2.fill(e7);
       
       //foco
  Ellipse2D e8= new Ellipse2D.Float(145,210,15,15);
       g2.setColor(Color.BLACK);
       g2.setStroke(pincel);
       g2.draw(e8);
       g2.setColor(Color.ORANGE);
       g2.fill(e8);
       
         Rectangle2D ultim = new Rectangle2D.Float(155, 210, 155, 15);
       g2.setColor(Color.BLACK);
       g2.setStroke(pincel);
       g2.draw(ultim);
       g2.setColor(Color.green);
       g2.fill(ultim);
       
       
       
    }

}
